home *** CD-ROM | disk | FTP | other *** search
- From: mikew@wyse.wyse.com (Mike Wexler)
- Newsgroups: comp.sources.x
- Subject: v02i004: update to xtools, Patch1
- Message-ID: <1794@wyse.wyse.com>
- Date: 18 Oct 88 22:47:25 GMT
- Approved: mikew@wyse.com
-
- Submitted-by: rusty%grunt.Berkeley.EDU@jade.berkeley.edu
- Posting-number: Volume 2, Issue 4
- Archive-name: xtools/patch1
-
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of shell archive."
- # Contents: Makefile.bak README_v1.0 README_v1.1 XTools.ad
- # XTools_popup.ad patch_v1.1 patchlevel.h
- # Wrapped by rusty@grunt on Fri Oct 14 18:23:41 1988
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'Makefile.bak' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile.bak'\"
- else
- echo shar: Extracting \"'Makefile.bak'\" \(4528 characters\)
- sed "s/^X//" >'Makefile.bak' <<'END_OF_FILE'
- X#
- X# Warning: the cpp used on this machine replaces
- X# all newlines and multiple tabs/spaces in a macro
- X# expansion with a single space. Imake tries to
- X# compensate for this, but is not always
- X# successful.
- X#
- X
- X#
- X# This makefile is automatically generated by imake... do not modify
- X# or you may lose your changes when imake generates makefiles again.
- X# Ignore this message if you are not using imake.
- X#
- X
- X TOP = ./../..
- X AS = as
- X CC = cc
- X CPP = /lib/cpp
- X LD = ld
- X LINT = lint
- X INSTALL = install
- X TAGS = ctags
- X RM = rm -f
- X MV = mv
- X LN = ln -s
- X RANLIB = ranlib
- X AR = ar clq
- X LS = ls
- X LINTOPTS = -axz
- X LINTLIBFLAG = -C
- X MAKE = make
- X STD_DEFINES =
- X CDEBUGFLAGS = -O
- X DESTDIR =
- X
- X PATHSEP = /
- X DEPEND = $(DEPENDSRC)/makedepend
- X IMAKE = $(IMAKESRC)/imake
- X RGB = $(RGBSRC)/rgb
- X CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES) $(DEFINES)
- X LINTFLAGS = $(LINTOPTS) $(INCLUDES) $(STD_DEFINES) $(DEFINES) -DLINT
- X LDFLAGS = $(CDEBUGFLAGS) $(SYS_LIBRARIES) $(SYSAUX_LIBRARIES)
- X INSTUIDFLAGS = -m 4555
- X INSTLIBFLAGS = -m 0444
- X INSTINCFLAGS = -m 0444
- X INSTMANFLAGS = -m 0444
- X INSTAPPFLAGS = -m 0444
- X
- X USRLIBDIR = $(DESTDIR)/tuna_a/x11/lib
- X BINDIR = $(DESTDIR)/tuna_a/x11/bin
- X LIBDIR = $(USRLIBDIR)
- X LINTLIBDIR = $(USRLIBDIR)/lint
- X INCDIR = $(DESTDIR)/tuna_a/x11/include
- X FONTDIR = $(LIBDIR)/fonts
- X UWMDIR = $(LIBDIR)/uwm
- X MANDIR = $(DESTDIR)/tuna_a/x11/man/mann
- X XAPPLOADDIR = $(LIBDIR)/app-defaults
- X ADMDIR = $(DESTDIR)/tuna_a/x11/adm
- X
- X CLIENTSRC = $(TOP)/clients
- X DEMOSRC = $(TOP)/demos
- X LIBSRC = $(TOP)/lib
- X FONTSRC = $(TOP)/fonts
- X INCLUDESRC = $(TOP)/X11
- X SERVERSRC = $(TOP)/server
- X UTILSRC = $(TOP)/util
- X EXAMPLESRC = $(TOP)/examples
- X CONTRIBSRC = $(TOP)/contrib
- X DOCSRC = $(TOP)/doc
- X DEPENDSRC = $(UTILSRC)/makedepend
- X IMAKESRC = $(UTILSRC)/imake
- X IRULESRC = $(UTILSRC)/imake.includes
- X RGBSRC = $(UTILSRC)/rgb
- X XLIBSRC = $(LIBSRC)/X
- X TOOLKITSRC = $(LIBSRC)/Xt
- X AWIDGETSRC = $(LIBSRC)/Xaw
- X OLDXLIBSRC = $(LIBSRC)/oldX
- X EXTENSIONSRC = $(TOP)/extensions
- X XMANSRC = $(DOCSRC)/Xlib/Xman
- X EXTENSIONLIB = $(EXTENSIONSRC)/lib/libXext.a
- X XLIB = $(XLIBSRC)/libX11.a
- X OLDXLIB = $(OLDXLIBSRC)/liboldX.a
- X XTOOLLIB = $(TOOLKITSRC)/libXt.a
- X XAWLIB = $(AWIDGETSRC)/libXaw.a
- X LINTXLIB = $(XLIBSRC)/llib-lX11.ln
- X LINTXTOOL = $(TOOLKITSRC)/llib-lXt.ln
- X LINTXAW = $(AWIDGETSRC)/llib-lXaw.ln
- X INCLUDES = -I$(TOP)
- X MACROFILE = Sun.macros
- X IMAKE_CMD = $(NEWTOP)$(IMAKE) -TImake.tmpl \
- X -I$(NEWTOP)$(IRULESRC) \
- X -s Makefile
- X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
- X tags TAGS make.log
- X
- X INCLUDES = -I$(TOP) -I$(TOP)/X11
- XLOCAL_LIBRARIES = $(XAWLIB) $(XTOOLLIB) $(XLIB)
- XDEFAULT_STARTUP = $(LIBDIR)/xtools_startup
- X STD_DEFINES = -DDEFAULT_STARTUP=\"$(DEFAULT_STARTUP)\" -Duse_popup
- X
- X SRCS = top_setup.c home_setup.c quit_button.c help_button.c \
- X confirm_setup.c main.c client_start.c globs.c parse.c \
- X yep_button.c nope_button.c setenv.c
- X
- X OBJS = top_setup.o home_setup.o quit_button.o help_button.o \
- X confirm_setup.o main.o client_start.o globs.o parse.o \
- X yep_button.o nope_button.o setenv.o
- X
- X PROGRAM = xtools
- X
- Xall:: xtools
- X
- Xxtools: $(OBJS) $(LOCAL_LIBRARIES)
- X $(RM) $@
- X $(CC) -o $@ $(OBJS) $(LOCAL_LIBRARIES) $(LDFLAGS)
- X
- Xrelink::
- X $(RM) $(PROGRAM)
- X $(MAKE) $(MFLAGS) $(PROGRAM)
- X
- Xinstall:: xtools
- X $(INSTALL) -c $(INSTALLFLAGS) xtools $(BINDIR)
- X
- Xinstall:: xtools.man
- X $(INSTALL) -c $(INSTMANFLAGS) xtools.man $(MANDIR)/xtools.n
- X
- Xdepend:: $(DEPEND)
- X
- Xdepend::
- X $(DEPEND) -s "# DO NOT DELETE" -- $(CFLAGS) -- $(SRCS)
- X
- X$(DEPEND):
- X @echo "making $(DEPENDSRC)"; \
- X cd $(DEPENDSRC); $(MAKE)
- X
- Xclean::
- X $(RM) $(PROGRAM)
- X
- Xinstall:: XTools.ad
- X $(INSTALL) -c $(INSTAPPFLAGS) XTools.ad $(XAPPLOADDIR)/XTools
- X
- Xclean::
- X $(RM_CMD) \#*
- X
- XMakefile:: $(IMAKE)
- X
- XMakefile:: Imakefile \
- X $(IRULESRC)/Imake.tmpl \
- X $(IRULESRC)/Imake.rules \
- X $(IRULESRC)/$(MACROFILE)
- X -$(RM) Makefile.bak; $(MV) Makefile Makefile.bak
- X $(IMAKE_CMD) -DTOPDIR=$(TOP)
- X
- X$(IMAKE):
- X @echo "making $(IMAKESRC)"; \
- X cd $(IMAKESRC); $(MAKE)
- X
- Xtags::
- X $(TAGS) -w *.[ch]
- X $(TAGS) -xw *.[ch] > TAGS
- X
- Xinstall::
- X @echo "install done"
- X
- XMakefiles::
- X
- END_OF_FILE
- if test 4528 -ne `wc -c <'Makefile.bak'`; then
- echo shar: \"'Makefile.bak'\" unpacked with wrong size!
- fi
- # end of 'Makefile.bak'
- fi
- if test -f 'README_v1.0' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README_v1.0'\"
- else
- echo shar: Extracting \"'README_v1.0'\" \(2937 characters\)
- sed "s/^X//" >'README_v1.0' <<'END_OF_FILE'
- XThis is my version of xtools for version 11 of the X Window System. I
- Xfind it useful on my SUN because I don't like having the console
- Xwindow started up by xinit because if I accidently or otherwise exit
- Xfrom the console window then I get booted out of X.
- X
- XThere isn't a manual page yet so here's a quick description:
- X
- Xxtools reads the file ~/.xtools and executes each line. Things that
- Xyou want to run in the background (pretty much everything) must have
- Xan ampersand (&) at the end of their lines. Anything that you don't
- Xwant to run in the background (no ampersand at the end) MUST come
- Xfirst in your .xtools file, otherwise xtools will hang.
- X
- XHere's what my .xtools file looks like:
- X
- X
- Xxrdb .xdb
- Xxhost cartan yuban ovaltine bosco
- Xxset m 8 8 r off c 100
- Xxsetroot -gray
- Xtwm &
- Xxterm -i -s -n cartan -T cartan #0x0-85+100 -e cartan -e &
- Xxterm -i -s -n brahms -T brahms #0x0-85+135 -e brahms -e &
- Xxterm -i -s -n bosco -T bosco #0x0-85+170 -e bosco -e &
- Xxterm -i -s -n yuban -T yuban #0x0-85+205 -e yuban -e &
- Xxterm -i -s -n ovaltine -T ovaltine #0x0-85+240 -e ovaltine -e &
- Xxterm -i -s -n velveeta -T velveeta #0x0-85+275 &
- Xxterm -i -C -r -s -n CONSOLE -T CONSOLE -fn screenb-12 -geo 80x24+1-1 #0x0-85+310 &
- Xxperfmon =175x290-115+0 & xclock &
- Xxbiff &
- X
- X
- Xxtools was written with the Athena Widgets. This means that you could
- Xload properties into the root window for it but since it is started up
- Xby xinit that doesn't work, but they are seen if you put them in your
- X.Xdefaults file. Here's what I have in mine:
- X
- X
- Xxtools*geometry: -1-100
- Xxtools*icon: on
- Xxtools*home.font: vbee-36
- Xxtools*confirm.font: vbee-36
- X
- X
- XIn addition to the regular command line options supported by the
- XToolkit, xtools also accepts the flag -file which should be followed
- Xby the name of a file which will be used instead of the ~/.xtools
- Xfile. There is also a -debug flag, but I haven't used it recently and
- Xdon't know if it still does anything reasonable or useful.
- X
- XIMPORTANT NOTE: As with the xtools for version 10, you must either set
- Xthe DISPLAY environment variable before starting or specify the
- Xdisplay on the command line to xtools. I have the following in my
- X.cshrc file:
- X
- Xset hostname = ` hostname | sed -e 's/\..*//' `
- Xalias x 'xinit xtools -display ${hostname}:0 ; \\
- X setkeys reset ; \\
- X clear'
- X
- XUnlike the version 10 xtools, this one doesn't have a menu; it just
- Xhas 2 buttons; "quit" and "help" (the help button is dimmed because I
- Xhaven't put in any code for it). When you press the quit button
- Xanother window pops up for confirmation; if you press the "nope"
- Xbutton then you're left where you were and if you press the "yep"
- Xbutton then it kills off all of the windows. Since I added the
- X&-at-the-end-of-the-line-feature I now get some (what appears to me to
- Xbe) non-serious messages when quitting. Dunno why.
- X
- X--------------------------------------
- X rusty c. wright
- X rusty@cartan.berkeley.edu
- X ucbvax!cartan!rusty
- END_OF_FILE
- if test 2937 -ne `wc -c <'README_v1.0'`; then
- echo shar: \"'README_v1.0'\" unpacked with wrong size!
- fi
- # end of 'README_v1.0'
- fi
- if test -f 'README_v1.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README_v1.1'\"
- else
- echo shar: Extracting \"'README_v1.1'\" \(834 characters\)
- sed "s/^X//" >'README_v1.1' <<'END_OF_FILE'
- XChanges from version 1.0:
- X
- XYou don't need to have -Duse_popup in the CFLAGS in the makefile any
- Xmore. If you don't, it now uses the existing (xtools) window for the
- Xconfirmation window instead of popping up another window. As it is
- Xcurrently distributed it doesn't use -Duse_popup in CFLAGS.
- X
- XLines in your .xtools file can now be in any order; you don't need to
- Xhave the & lines last any more.
- X
- XAll strings (labels) and whatnot are now specified by the defaults file
- Xlib/app-defaults/XTools. When you install xtools be sure that the
- Xfile XTools.ad gets copied to lib/app-defaults/XTools. If you use
- X-Duse_popup then rename XTools.ad to XTools_nopupup.ad and rename
- XXTools_popup.ad to XTools.ad before you do "make install".
- X
- X--------------------------------------
- X rusty c. wright
- X rusty@cartan.berkeley.edu
- X ucbvax!cartan!rusty
- END_OF_FILE
- if test 834 -ne `wc -c <'README_v1.1'`; then
- echo shar: \"'README_v1.1'\" unpacked with wrong size!
- fi
- # end of 'README_v1.1'
- fi
- if test -f 'XTools.ad' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'XTools.ad'\"
- else
- echo shar: Extracting \"'XTools.ad'\" \(625 characters\)
- sed "s/^X//" >'XTools.ad' <<'END_OF_FILE'
- Xxtools.top_shell.top_form.home_form.borderWidth: 0
- X
- Xxtools.top_shell.top_form.home_form.home_label.label: xtools
- Xxtools.top_shell.top_form.home_form.home_label.borderWidth: 0
- X
- Xxtools.top_shell.top_form.home_form.quit_button.label: quit
- Xxtools.top_shell.top_form.home_form.help_button.label: help
- X
- Xxtools.top_shell.top_form.confirm_form.borderWidth: 0
- X
- Xxtools.top_shell.top_form.confirm_form.confirm_label.label: REALLY?
- Xxtools.top_shell.top_form.confirm_form.confirm_label.borderWidth: 0
- X
- Xxtools.top_shell.top_form.confirm_form.yes_button.label: yes
- Xxtools.top_shell.top_form.confirm_form.no_button.label: no
- X
- END_OF_FILE
- if test 625 -ne `wc -c <'XTools.ad'`; then
- echo shar: \"'XTools.ad'\" unpacked with wrong size!
- fi
- # end of 'XTools.ad'
- fi
- if test -f 'XTools_popup.ad' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'XTools_popup.ad'\"
- else
- echo shar: Extracting \"'XTools_popup.ad'\" \(695 characters\)
- sed "s/^X//" >'XTools_popup.ad' <<'END_OF_FILE'
- Xxtools.top_shell.top_form.home_form.borderWidth: 0
- X
- Xxtools.top_shell.top_form.home_form.home_label.label: xtools
- Xxtools.top_shell.top_form.home_form.home_label.borderWidth: 0
- X
- Xxtools.top_shell.top_form.home_form.quit_button.label: quit
- Xxtools.top_shell.top_form.home_form.help_button.label: help
- X
- Xxtools.top_shell.top_form.confirm_shell.confirm_form.borderWidth: 0
- X
- Xxtools.top_shell.top_form.confirm_shell.confirm_form.confirm_label.label: REALLY?
- Xxtools.top_shell.top_form.confirm_shell.confirm_form.confirm_label.borderWidth: 0
- X
- Xxtools.top_shell.top_form.confirm_shell.confirm_form.yes_button.label: yes
- Xxtools.top_shell.top_form.confirm_shell.confirm_form.no_button.label: no
- X
- END_OF_FILE
- if test 695 -ne `wc -c <'XTools_popup.ad'`; then
- echo shar: \"'XTools_popup.ad'\" unpacked with wrong size!
- fi
- # end of 'XTools_popup.ad'
- fi
- if test -f 'patch_v1.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patch_v1.1'\"
- else
- echo shar: Extracting \"'patch_v1.1'\" \(18990 characters\)
- sed "s/^X//" >'patch_v1.1' <<'END_OF_FILE'
- Xdiff -r -c xtools_old/Imakefile xtools/Imakefile
- X*** xtools_old/Imakefile Thu Sep 29 14:17:07 1988
- X--- xtools/Imakefile Thu Sep 29 14:41:58 1988
- X***************
- X*** 1,14 ****
- X INCLUDES = -I$(TOP) -I$(TOP)/X11
- X LOCAL_LIBRARIES = $(XAWLIB) $(XTOOLLIB) $(XLIB)
- X DEFAULT_STARTUP = $(LIBDIR)/xtools_startup
- X! STD_DEFINES = -DDEFAULT_STARTUP=\"$(DEFAULT_STARTUP)\" -Duse_popup
- X
- X! SRCS = top_setup.c home_setup.c quit_button.c help_button.c \
- X! confirm_setup.c main.c client_start.c globs.c parse.c \
- X! yep_button.c nope_button.c setenv.c
- X
- X! OBJS = top_setup.o home_setup.o quit_button.o help_button.o \
- X! confirm_setup.o main.o client_start.o globs.o parse.o \
- X! yep_button.o nope_button.o setenv.o
- X
- X ComplexProgramTarget(xtools)
- X--- 1,15 ----
- X INCLUDES = -I$(TOP) -I$(TOP)/X11
- X LOCAL_LIBRARIES = $(XAWLIB) $(XTOOLLIB) $(XLIB)
- X DEFAULT_STARTUP = $(LIBDIR)/xtools_startup
- X! STD_DEFINES = -DDEFAULT_STARTUP=\"$(DEFAULT_STARTUP)\"
- X
- X! SRCS = top_setup.c home_setup.c quit_button.c help_button.c \
- X! confirm_setup.c main.c client_start.c globs.c parse.c \
- X! yep_button.c nope_button.c setenv.c
- X
- X! OBJS = top_setup.o home_setup.o quit_button.o help_button.o \
- X! confirm_setup.o main.o client_start.o globs.o parse.o \
- X! yep_button.o nope_button.o setenv.o
- X
- X ComplexProgramTarget(xtools)
- X+ InstallAppDefaults(XTools)
- XOnly in xtools: Makefile
- XOnly in xtools: README
- XOnly in xtools: SCCS
- XOnly in xtools: XTools.ad
- XOnly in xtools: XTools_popup.ad
- Xdiff -r -c xtools_old/client_start.c xtools/client_start.c
- X*** xtools_old/client_start.c Thu Sep 29 14:17:03 1988
- X--- xtools/client_start.c Thu Sep 22 22:37:05 1988
- X***************
- X*** 1,6 ****
- X--- 1,9 ----
- X+ /* %A% Workstation Software Support %G% */
- X+
- X # include <X11/Intrinsic.h>
- X # include <sys/wait.h>
- X # include <sys/file.h>
- X+ # include <setjmp.h>
- X # include <signal.h>
- X # include <fcntl.h>
- X # include <pwd.h>
- X***************
- X*** 8,13 ****
- X--- 11,18 ----
- X
- X # include "globs.h"
- X
- X+ static jmp_buf env;
- X+
- X static int pids[128];
- X static int npids;
- X static int dohang;
- X***************
- X*** 17,24 ****
- X */
- X client_start() {
- X extern char *index();
- X! extern void shutdown();
- X! extern void cleanup();
- X extern char *getname();
- X extern char *getline();
- X FILE *fd;
- X--- 22,29 ----
- X */
- X client_start() {
- X extern char *index();
- X! extern void fn_sigint();
- X! extern void fn_sigchld();
- X extern char *getname();
- X extern char *getline();
- X FILE *fd;
- X***************
- X*** 49,65 ****
- X return(-1);
- X }
- X
- X! (void) signal(SIGINT, (int (*)()) shutdown);
- X! (void) signal(SIGCHLD, (int (*)()) cleanup);
- X
- X while ((cp = getline(fd)) != NULL) {
- X if (execute(cp) == -1)
- X (void) fprintf(stderr, "can't execute \"%s\"\n", cp);
- X }
- X- dohang = 0;
- X
- X fclose(fd);
- X
- X return(0);
- X }
- X
- X--- 54,71 ----
- X return(-1);
- X }
- X
- X! (void) signal(SIGINT, (int (*)()) fn_sigint);
- X! (void) signal(SIGCHLD, (int (*)()) fn_sigchld);
- X
- X while ((cp = getline(fd)) != NULL) {
- X if (execute(cp) == -1)
- X (void) fprintf(stderr, "can't execute \"%s\"\n", cp);
- X }
- X
- X fclose(fd);
- X
- X+ dohang = 0;
- X+
- X return(0);
- X }
- X
- X***************
- X*** 131,138 ****
- X--- 137,146 ----
- X char *line;
- X {
- X extern char **getargs();
- X+ extern void cleanup();
- X extern void checkamp();
- X char **args;
- X+ int omask;
- X int pid;
- X int i;
- X
- X***************
- X*** 139,146 ****
- X if ((args = getargs(line)) == NULL)
- X return(-1);
- X
- X- checkamp(args);
- X-
- X if (debug) {
- X (void) printf("execvp(\"%s\"", args[0]);
- X for (i = 1; args[i] != NULL; i++)
- X--- 147,152 ----
- X***************
- X*** 149,155 ****
- X return(0);
- X }
- X
- X! if ((pid = fork()) == 0) {
- X if (setpgrp(0, getpid()) == -1)
- X perror("setpgrp(0)");
- X
- X--- 155,167 ----
- X return(0);
- X }
- X
- X! checkamp(args);
- X!
- X! /* block sigchld signals until we arm setjmp/longjmp */
- X! if (dohang)
- X! omask = sigblock(sigmask(SIGCHLD));
- X!
- X! if ((pid = vfork()) == 0) {
- X if (setpgrp(0, getpid()) == -1)
- X perror("setpgrp(0)");
- X
- X***************
- X*** 178,184 ****
- X else /* pid == -1, fork failed */
- X return(-1);
- X
- X! cleanup();
- X
- X return(0);
- X }
- X--- 190,196 ----
- X else /* pid == -1, fork failed */
- X return(-1);
- X
- X! cleanup(pid, omask);
- X
- X return(0);
- X }
- X***************
- X*** 204,209 ****
- X--- 216,222 ----
- X i--; /* back up to last non-NULL arg */
- X
- X cp = args[i];
- X+
- X if (strcmp(cp, "&") == 0) {
- X args[i] = NULL;
- X dohang = 0;
- X***************
- X*** 218,230 ****
- X int sigs[] = { SIGTERM /* , SIGHUP, SIGKILL */ };
- X
- X /*
- X! * shutdown is called when quitting. it kills all outstanding
- X * processes.
- X */
- X static void
- X! shutdown() {
- X int i, j;
- X
- X for (j = 0; j < SIGS; j++) {
- X for (i = 0; i < npids; i++) {
- X if (pids[i] == 0)
- X--- 231,248 ----
- X int sigs[] = { SIGTERM /* , SIGHUP, SIGKILL */ };
- X
- X /*
- X! * fn_sigint is called when quitting. it kills all outstanding
- X * processes.
- X */
- X static void
- X! fn_sigint() {
- X! extern void fn_sigint();
- X int i, j;
- X
- X+ (void) signal(SIGINT, (int (*)()) fn_sigint);
- X+
- X+ dohang = 0;
- X+
- X for (j = 0; j < SIGS; j++) {
- X for (i = 0; i < npids; i++) {
- X if (pids[i] == 0)
- X***************
- X*** 243,256 ****
- X if (debug)
- X (void) printf("can't kill pid %d\n",
- X pids[i]);
- X continue;
- X }
- X }
- X }
- X
- X- dohang = 0;
- X- cleanup();
- X-
- X exit(0);
- X }
- X
- X--- 261,272 ----
- X if (debug)
- X (void) printf("can't kill pid %d\n",
- X pids[i]);
- X+
- X continue;
- X }
- X }
- X }
- X
- X exit(0);
- X }
- X
- X***************
- X*** 258,272 ****
- X * cleanup collectes dead children.
- X */
- X static void
- X! cleanup() {
- X union wait status;
- X- int options;
- X int pid;
- X int i;
- X
- X! options = (dohang == 1) ? 0 : WNOHANG;
- X
- X! while ((pid = wait3(&status, options, (struct rusage *) NULL)) > 0) {
- X for (i = 0; i < npids; i++) {
- X if (pids[i] == pid) {
- X if (debug)
- X--- 274,304 ----
- X * cleanup collectes dead children.
- X */
- X static void
- X! cleanup(pid, omask) {
- X! int val;
- X!
- X! if (dohang && (pid != 0)) {
- X! while ((val = setjmp(env)) != pid) {
- X! /*
- X! * if val is 0 then we've armed setjmp/longjmp
- X! * so unblock sigchld signals.
- X! */
- X! if (val == 0)
- X! (void) sigsetmask(omask);
- X! }
- X! }
- X! }
- X!
- X! static void
- X! fn_sigchld() {
- X! extern void fn_sigchld();
- X union wait status;
- X int pid;
- X int i;
- X
- X! (void) signal(SIGCHLD, (int (*)()) fn_sigchld);
- X
- X! if ((pid = wait3(&status, WNOHANG, (struct rusage *) NULL)) > 0) {
- X for (i = 0; i < npids; i++) {
- X if (pids[i] == pid) {
- X if (debug)
- X***************
- X*** 280,286 ****
- X while (pids[npids-1] == 0) {
- X npids--;
- X if (npids == 0)
- X! return;
- X }
- X }
- X }
- X--- 312,321 ----
- X while (pids[npids-1] == 0) {
- X npids--;
- X if (npids == 0)
- X! break;
- X }
- X+
- X+ if (dohang)
- X+ longjmp(env, pid);
- X }
- X }
- Xdiff -r -c xtools_old/confirm_setup.c xtools/confirm_setup.c
- X*** xtools_old/confirm_setup.c Thu Sep 29 14:17:01 1988
- X--- xtools/confirm_setup.c Thu Sep 29 13:47:59 1988
- X***************
- X*** 22,36 ****
- X static int confirm_popup_args_n = XtNumber(confirm_popup_args);
- X # endif /* use_popup */
- X
- X- static char label_text[] = "REALLY QUIT?";
- X-
- X- static Arg label_args[] = {
- X- { XtNlabel, (XtArgVal) label_text },
- X- { XtNborderWidth, (XtArgVal) 0 },
- X- };
- X-
- X- static int label_args_n = XtNumber(label_args);
- X-
- X Widget
- X confirm_setup(parent, home_form)
- X Widget parent;
- X--- 22,27 ----
- X***************
- X*** 49,81 ****
- X DisplayHeight(XtDisplay(parent),
- X XDefaultScreen(XtDisplay(parent)))/2);
- X
- X! confirm_popup = XtCreatePopupShell("confirm",
- X transientShellWidgetClass, parent,
- X confirm_popup_args,
- X confirm_popup_args_n);
- X
- X! confirm_form = XtCreateManagedWidget("confirm", formWidgetClass,
- X confirm_popup, NULL, 0);
- X! # else /* use_popup */
- X! confirm_form = XtCreateWidget("confirm", formWidgetClass,
- X! parent, NULL, 0);
- X # endif /* use_popup */
- X
- X! /* XtSetArg(label_args[2], XtNfont, query_font); */
- X! label_widget = XtCreateManagedWidget("confirm", labelWidgetClass,
- X! confirm_form, label_args,
- X! label_args_n);
- X
- X! yep_button = XtCreateManagedWidget("yep", commandWidgetClass,
- X! confirm_form, yep_button_args,
- X! yep_button_args_n);
- X XtSetArg(args[0], XtNfromVert, label_widget);
- X XtSetValues(yep_button, args, 1);
- X XtAddCallback(yep_button, XtNcallback, yep_func, (caddr_t) parent);
- X
- X! nope_button = XtCreateManagedWidget("nope", commandWidgetClass,
- X! confirm_form, nope_button_args,
- X! nope_button_args_n);
- X XtSetArg(args[0], XtNfromVert, label_widget);
- X XtSetValues(nope_button, args, 1);
- X XtSetArg(args[0], XtNfromHoriz, yep_button);
- X--- 40,68 ----
- X DisplayHeight(XtDisplay(parent),
- X XDefaultScreen(XtDisplay(parent)))/2);
- X
- X! confirm_popup = XtCreatePopupShell("confirm_shell",
- X transientShellWidgetClass, parent,
- X confirm_popup_args,
- X confirm_popup_args_n);
- X
- X! confirm_form = XtCreateManagedWidget("confirm_form", formWidgetClass,
- X confirm_popup, NULL, 0);
- X! # else /* not use_popup */
- X! confirm_form = XtCreateWidget("confirm_form", formWidgetClass, parent,
- X! NULL, 0);
- X # endif /* use_popup */
- X
- X! label_widget = XtCreateManagedWidget("confirm_label", labelWidgetClass,
- X! confirm_form, NULL, 0);
- X
- X! yep_button = XtCreateManagedWidget("yes_button", commandWidgetClass,
- X! confirm_form, NULL, 0);
- X XtSetArg(args[0], XtNfromVert, label_widget);
- X XtSetValues(yep_button, args, 1);
- X XtAddCallback(yep_button, XtNcallback, yep_func, (caddr_t) parent);
- X
- X! nope_button = XtCreateManagedWidget("no_button", commandWidgetClass,
- X! confirm_form, NULL, 0);
- X XtSetArg(args[0], XtNfromVert, label_widget);
- X XtSetValues(nope_button, args, 1);
- X XtSetArg(args[0], XtNfromHoriz, yep_button);
- X***************
- X*** 85,90 ****
- X--- 72,79 ----
- X
- X # ifdef use_popup
- X XtRealizeWidget(confirm_popup);
- X+ # else /* use_popup */
- X+ XtRealizeWidget(confirm_form);
- X # endif /* use_popup */
- X
- X return(confirm_form);
- Xdiff -r -c xtools_old/help_button.c xtools/help_button.c
- X*** xtools_old/help_button.c Thu Sep 29 14:17:01 1988
- X--- xtools/help_button.c Thu Sep 29 15:09:21 1988
- X***************
- X*** 5,19 ****
- X
- X # include "home_globs.h"
- X
- X- static char help_button_label[] = "help";
- X-
- X- Arg help_button_args[] = {
- X- { XtNlabel, (XtArgVal) help_button_label },
- X- { XtNsensitive, (XtArgVal) False },
- X- };
- X-
- X- int help_button_args_n = XtNumber(help_button_args);
- X-
- X void
- X help_func(w, client_data, call_data)
- X Widget w;
- X--- 5,10 ----
- Xdiff -r -c xtools_old/home_setup.c xtools/home_setup.c
- X*** xtools_old/home_setup.c Thu Sep 29 14:17:00 1988
- X--- xtools/home_setup.c Thu Sep 29 15:09:15 1988
- X***************
- X*** 6,20 ****
- X
- X # include "home_globs.h"
- X
- X- static char label_text[] = "xtools";
- X-
- X- static Arg label_args[] = {
- X- { XtNlabel, (XtArgVal) label_text },
- X- { XtNborderWidth, (XtArgVal) 0 },
- X- };
- X-
- X- static int label_args_n = XtNumber(label_args);
- X-
- X Widget quit_button;
- X
- X Widget
- X--- 6,11 ----
- X***************
- X*** 26,52 ****
- X Widget help_button;
- X Arg args[1];
- X
- X! home_form = XtCreateWidget("home", formWidgetClass, parent,
- X NULL, 0);
- X
- X! label_widget = XtCreateManagedWidget("home", labelWidgetClass,
- X! home_form, label_args,
- X! label_args_n);
- X
- X! quit_button = XtCreateManagedWidget("quit", commandWidgetClass,
- X! home_form, quit_button_args,
- X! quit_button_args_n);
- X XtSetArg(args[0], XtNfromVert, label_widget);
- X XtSetValues(quit_button, args, 1);
- X XtAddCallback(quit_button, XtNcallback, quit_func,
- X (caddr_t) home_form);
- X
- X! help_button = XtCreateManagedWidget("help", commandWidgetClass,
- X! home_form, help_button_args,
- X! help_button_args_n);
- X XtSetArg(args[0], XtNfromHoriz, quit_button);
- X XtSetValues(help_button, args, 1);
- X XtSetArg(args[0], XtNfromVert, label_widget);
- X XtSetValues(help_button, args, 1);
- X XtAddCallback(help_button, XtNcallback, help_func,
- X (caddr_t) home_form);
- X--- 17,42 ----
- X Widget help_button;
- X Arg args[1];
- X
- X! home_form = XtCreateWidget("home_form", formWidgetClass, parent,
- X NULL, 0);
- X
- X! label_widget = XtCreateManagedWidget("home_label", labelWidgetClass,
- X! home_form, NULL, 0);
- X
- X! quit_button = XtCreateManagedWidget("quit_button", commandWidgetClass,
- X! home_form, NULL, 0);
- X XtSetArg(args[0], XtNfromVert, label_widget);
- X XtSetValues(quit_button, args, 1);
- X XtAddCallback(quit_button, XtNcallback, quit_func,
- X (caddr_t) home_form);
- X
- X! help_button = XtCreateManagedWidget("help_button", commandWidgetClass,
- X! home_form, NULL, 0);
- X XtSetArg(args[0], XtNfromHoriz, quit_button);
- X XtSetValues(help_button, args, 1);
- X XtSetArg(args[0], XtNfromVert, label_widget);
- X+ XtSetValues(help_button, args, 1);
- X+ XtSetArg(args[0], XtNsensitive, False);
- X XtSetValues(help_button, args, 1);
- X XtAddCallback(help_button, XtNcallback, help_func,
- X (caddr_t) home_form);
- Xdiff -r -c xtools_old/nope_button.c xtools/nope_button.c
- X*** xtools_old/nope_button.c Thu Sep 29 14:17:04 1988
- X--- xtools/nope_button.c Thu Sep 29 13:31:16 1988
- X***************
- X*** 6,19 ****
- X # include "home_globs.h"
- X # include "confirm_globs.h"
- X
- X- static char nope_button_label[] = "nope";
- X-
- X- Arg nope_button_args[] = {
- X- { XtNlabel, (XtArgVal) nope_button_label }
- X- };
- X-
- X- int nope_button_args_n = XtNumber(nope_button_args);
- X-
- X void
- X nope_func(w, client_data, call_data)
- X Widget w;
- X--- 6,11 ----
- X***************
- X*** 22,30 ****
- X {
- X # ifdef use_popup
- X XtPopdown(confirm_popup);
- X- XtSetSensitive(quit_button, True);
- X # else /* use_popup */
- X XtUnmanageChild(confirm_form);
- X XtManageChild((Widget) client_data);
- X # endif /* use_popup */
- X }
- X--- 14,22 ----
- X {
- X # ifdef use_popup
- X XtPopdown(confirm_popup);
- X # else /* use_popup */
- X XtUnmanageChild(confirm_form);
- X XtManageChild((Widget) client_data);
- X # endif /* use_popup */
- X+ XtSetSensitive(quit_button, True);
- X }
- XOnly in xtools: notes
- Xdiff -r -c xtools_old/quit_button.c xtools/quit_button.c
- X*** xtools_old/quit_button.c Thu Sep 29 14:17:00 1988
- X--- xtools/quit_button.c Thu Sep 29 13:35:31 1988
- X***************
- X*** 5,18 ****
- X # include "home_globs.h"
- X # include "confirm_globs.h"
- X
- X- static char quit_button_label[] = "quit";
- X-
- X- Arg quit_button_args[] = {
- X- { XtNlabel, (XtArgVal) quit_button_label }
- X- };
- X-
- X- int quit_button_args_n = XtNumber(quit_button_args);
- X-
- X void
- X quit_func(w, client_data, call_data)
- X Widget w;
- X--- 5,10 ----
- XOnly in xtools: resources
- Xdiff -r -c xtools_old/top_setup.c xtools/top_setup.c
- X*** xtools_old/top_setup.c Thu Sep 29 14:16:59 1988
- X--- xtools/top_setup.c Thu Sep 29 13:53:37 1988
- X***************
- X*** 14,28 ****
- X static Widget top_shell;
- X
- X static XrmOptionDescRec options[] = {
- X! { "-file", "file", XrmoptionSepArg, NULL },
- X! { "-debug", "debug", XrmoptionIsArg, "False" },
- X };
- X
- X static XtResource resources[] = {
- X { "file", "file", XtRString, sizeof(char *), (Cardinal) &file,
- X! XtRString, NULL },
- X { "debug", "debug", XtRBoolean, sizeof(Boolean), (Cardinal) &debug,
- X! XtRBoolean, 0 },
- X };
- X
- X Widget
- X--- 14,31 ----
- X static Widget top_shell;
- X
- X static XrmOptionDescRec options[] = {
- X! { "-file", "file", XrmoptionSepArg, (caddr_t) NULL },
- X! { "-debug", "debug", XrmoptionIsArg, (caddr_t) "False" },
- X! # ifdef unix /* THIS DOESN'T WORK */
- X! { "-display", "*display", XrmoptionSepArg, (caddr_t) "unix:0" },
- X! # endif unix
- X };
- X
- X static XtResource resources[] = {
- X { "file", "file", XtRString, sizeof(char *), (Cardinal) &file,
- X! XtRString, (caddr_t) NULL },
- X { "debug", "debug", XtRBoolean, sizeof(Boolean), (Cardinal) &debug,
- X! XtRBoolean, (caddr_t) NULL },
- X };
- X
- X Widget
- X***************
- X*** 33,39 ****
- X Widget top_form;
- X Arg args[1];
- X
- X! top_shell = XtInitialize("top", "XTools", options,
- X XtNumber(options), &argc, argv );
- X if (argc != 1)
- X usage();
- X--- 36,42 ----
- X Widget top_form;
- X Arg args[1];
- X
- X! top_shell = XtInitialize("top_shell", "XTools", options,
- X XtNumber(options), &argc, argv );
- X if (argc != 1)
- X usage();
- X***************
- X*** 54,61 ****
- X # ifdef use_popup
- X top_form = top_shell;
- X # else /* use_popup */
- X! top_form = XtCreateManagedWidget("top", formWidgetClass, top_shell,
- X! NULL, 0);
- X
- X XtSetArg(args[0], XtNallowShellResize, True);
- X XtSetValues(top_form, args, 1);
- X--- 57,64 ----
- X # ifdef use_popup
- X top_form = top_shell;
- X # else /* use_popup */
- X! top_form = XtCreateManagedWidget("top_form", formWidgetClass,
- X! top_shell, NULL, 0);
- X
- X XtSetArg(args[0], XtNallowShellResize, True);
- X XtSetValues(top_form, args, 1);
- Xdiff -r -c xtools_old/xtools.man xtools/xtools.man
- X*** xtools_old/xtools.man Thu Sep 29 14:17:09 1988
- X--- xtools/xtools.man Mon Aug 15 15:16:10 1988
- X***************
- X*** 33,44 ****
- X If none of the .xtools files with a machine or domain name exist then
- X it uses just ``.xtools''.
- X .SH CONFIGURATION FILE FORMAT
- X! The format of the .xtools file is the same as if you were typing the
- X! commands to the shell. (But note that csh-style tilde expansion is
- X! not implemented.) In particular, it is important to note that the
- X! command lines in the .xtools file must have an ampersand (&) at the
- X! end if the command is expected to run in the background (for example,
- X! xterm). A bug in
- X .I xtools
- X requires you to put all of those commands that don't run in the
- X background first. Here is a sample .xtools file
- X--- 33,45 ----
- X If none of the .xtools files with a machine or domain name exist then
- X it uses just ``.xtools''.
- X .SH CONFIGURATION FILE FORMAT
- X! The format of the .xtools file is similar to typing the commands to
- X! the shell. Notable differences are that csh-style tilde expansion is
- X! not implemented, quotes don't work, input and output redirection
- X! doesn't work; in other words, no shell metacharacters are recognized.
- X! In particular, it is important to note that the command lines in the
- X! .xtools file must have an ampersand (&) at the end if the command is
- X! expected to run in the background (for example, xterm). A bug in
- X .I xtools
- X requires you to put all of those commands that don't run in the
- X background first. Here is a sample .xtools file
- Xdiff -r -c xtools_old/yep_button.c xtools/yep_button.c
- X*** xtools_old/yep_button.c Thu Sep 29 14:17:04 1988
- X--- xtools/yep_button.c Thu Sep 29 13:32:19 1988
- X***************
- X*** 3,17 ****
- X # include <X11/Form.h>
- X # include <stdio.h>
- X
- X- static char yep_button_label[] = "yep";
- X-
- X- Arg yep_button_args[] = {
- X- { XtNfromVert, (XtArgVal) NULL },
- X- { XtNlabel, (XtArgVal) yep_button_label }
- X- };
- X-
- X- int yep_button_args_n = XtNumber(yep_button_args);
- X-
- X void
- X yep_func(w, client_data, call_data)
- X Widget w;
- X--- 3,8 ----
- END_OF_FILE
- if test 18990 -ne `wc -c <'patch_v1.1'`; then
- echo shar: \"'patch_v1.1'\" unpacked with wrong size!
- fi
- # end of 'patch_v1.1'
- fi
- if test -f 'patchlevel.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patchlevel.h'\"
- else
- echo shar: Extracting \"'patchlevel.h'\" \(4 characters\)
- sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
- X1.1
- END_OF_FILE
- if test 4 -ne `wc -c <'patchlevel.h'`; then
- echo shar: \"'patchlevel.h'\" unpacked with wrong size!
- fi
- # end of 'patchlevel.h'
- fi
- echo shar: End of shell archive.
- exit 0
- --
- Mike Wexler(wyse!mikew) Phone: (408)433-1000 x1330
- Moderator of comp.sources.x
-